package com.zzb.text.service;

import com.zzb.text.dao.UserRepository;
import com.zzb.text.entity.User;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

/**
 * Created by ZZB on 2017/6/16.
 */
@Service
public class UserService {
    @Autowired
    private UserRepository userRepository;
    public List<User> list(){
        return userRepository.findAll();
    }

    public void save(User user){
        userRepository.save(user);
    }

    public void delete(String id){
        userRepository.delete(id);
    }

    public User get(String id){
        return userRepository.getOne(id);
    }
}
